<tr>
    <td bgcolor="#e4e4e4">短链接</td>
    <td bgcolor="#e4e4e4">信息页</td>
    <td bgcolor="#e4e4e4">原链接地址</td>
</tr>
<?php if (is_array($rs)): ?>
    <script type="text/javascript" src="<?php echo $this->root; ?>/theme/default/u22/js/ZeroClipboard.js" charset="UTF-8"></script>

<?php foreach ($rs as $key => $value): ?>
        <tr id="act_1_<?php echo $key; ?>">
            <td><input id="copy_<?php echo $value->getUhash(); ?>" value="http://u22.cc/<?php echo $value->getUhash(); ?>" type="hidden" />u22.cc/<?php echo $value->getUhash(); ?><span class="copy red" id="copy_button_<?php echo $value->getUhash(); ?>">复制</span></td>
            <td><a href="http://u22.cc/<?php echo $value->getUhash(); ?>+"><?php echo $value->getUhash(); ?>+</a></td>
            <td>
        <?php
        $len = strlen($value->getUrl());
        if ($len > 40) {
            echo substr($value->getUrl(), 0, 40) . '...';
        } else {
            echo $value->getUrl();
            ;
        }
        ?>
    </td>
</tr>

<?php endforeach; ?>
<?php endif; ?>


<script>
    $(document).ready(function(){
        
        <?php if(!empty($rs)):?>
            var ss;
        <?php foreach ($rs as $key => $v): ?>
            ss = new ZeroClipboard.Client();
            ss.setHandCursor( true );
            ss.glue('copy_button_<?php echo $v->getUhash(); ?>');
            ss.setText( $('#copy_<?php echo $v->getUhash(); ?>').val());
            ss.addEventListener( "complete", function(){
                alert("复制成功！");
            });
        <?php endforeach; ?>
        <?php endif; ?>
    });

</script>